import unittest,time
from selenium import webdriver
from month.mail_163.Page.Page_sjqd import Page
from ddt import ddt,file_data

@ddt()
class TestCase(unittest.TestCase):
    def setUp(self):
        self.driver = webdriver.Firefox()

    def tearDown(self):
        self.driver.implicitly_wait(10)
        self.driver.quit()
    @file_data(r'E:\gg4\PythonProject1\month\mail_163\Data\mail.yaml')
    def test_01(self,username,password):
        try:
            po = Page(self.driver)
            po.luoji_01(username,password)
        except:
            t = time.strftime('%Y%m%d%H%M%S')
            self.driver.save_screenshot(t + '.png')

if __name__ == '__main__':
    unittest.TestCase()